import { RouterModule, Routes } from '@angular/router'
import { LoginComponent } from './pages/login/login.component'
import { RegisterComponent } from './pages/register/register.component'
import { RegisterPswComponent } from './pages/register-psw/register-psw.component'

const appRoutes: Routes = [
  {
    path: '',
    redirectTo: 'workspace',
    pathMatch: 'full'
  },
  {
    path: 'login',
    component: LoginComponent,
    data: {
      depth: 99
    }
  },
  {
    path: 'register',
    component: RegisterComponent,
    data: {
      depth: 98
    }
  },
  {
    path: 'registerPsw',
    component: RegisterPswComponent,
    data: {
      depth: 98
    }
  },
  {
    path: 'workspace',
    loadChildren: './pages/workspace/workspace.module#WorkspaceModule',
    data: {
      title: '房乐美',
      depth: 1
    }
  }
]

export const router = RouterModule.forRoot(appRoutes, { useHash: true })
